home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 10301 < prev    next >
Encoding:
Text File  |  1996-08-05  |  823 b   |  43 lines

  1. Newsgroups: comp.lang.c++
  2. Path: leeds.ac.uk!news
  3. From: men3sd@leeds.ac.uk (Stephen Davison)
  4. Subject: Casting / Calling through virtual classes?
  5. Message-ID: <313EDA5E.41C67EA6@leeds.ac.uk>
  6. NNTP-Posting-Host: englib4.leeds.ac.uk
  7. X-Mailer: Mozilla 2.0 (X11; I; SunOS 4.1.3C sun4m)
  8. Content-Type: text/plain; charset=us-ascii
  9. Organization: University of Leeds
  10. MIME-Version: 1.0
  11. Date: Thu, 7 Mar 1996 12:45:21 +0000 (GMT)
  12. CC: stephen@emissive.demon.co.uk
  13. Content-Transfer-Encoding: 7bit
  14.  
  15. Hello,
  16.  
  17. I have a number of virtual classes that go along these lines..
  18. Class Structure..
  19.  
  20.  
  21. stuff above
  22.  
  23. class curve
  24. {
  25. }
  26.  
  27. class bounded_curve : curve
  28. {
  29. }
  30.  
  31. class polyline : bounded_curve
  32. {
  33. ..stuff
  34. }
  35.  
  36. class composite_curve : bounded_curve
  37. {
  38. ... stuff
  39. }
  40.  
  41. Once in curve ie ( curve* cPtr = parent_curve() )
  42. how do I get to the class polyline etc.
  43.